import axios from 'axios';
let baseUrl = 'http://localhost:8008';

export default {
    login(teacher) {
        fetch(`${baseUrl}/teacher/login`, {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            },
            body: JSON.stringify(teacher)
        }).then(res => {
            return res.json();
        }).then(data => {
            return data;
        });
    },
    selectTeacherById(id) {
        // fetch(`${baseUrl}/teacher/selectTeacherById/${id}`).then(res => {
        //     return res.json();
        // }).then(data => {
        //     return data;
        // });
        axios.get(`${baseUrl}/teacher/selectTeacherById/${id}`).then(res => {
            return res.data;
        })
    },
}
